<?php
require_once("func.php");

/*
incomming
	$id			4	taskcode-id
	$state		1/0
	$zoom_id	$_GET['zoom_id']
*/

#debug($_POST);

if(!empty($_GET['id']) AND !empty($_GET['zoom_id']))
{
	if($_GET['state'] == 1)
	{	// state is task_done, switch to NOT done
		$sql = "update minitodos set date_finished=NULL where id = '".$_GET['id']."'";	
	}
	else
	{	// state is task_NOT_done, switch to done
		$sql = "update minitodos set date_finished=NOW() where id = '".$_GET['id']."'";
	}

	dbq($sql);
	header("Location: index.php?zoom_id=".$_GET['zoom_id']."");
	exit();
}

?>